package com.estate.system.domain.vo;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;

/**
 * 订单实体类
 * 对应图片中的表格结构
 */
public class SystemLogVo {
    private String id;           // 订单ID
    private String name;        // 客户姓名
    private String address;     // 收货地址
    private LocalDate date;     // 订单日期
    private String type;        // 商品类型
    private OrderStatus status; // 订单状态
    
    // 订单状态枚举
    public enum OrderStatus {
        COMPLETED("Completed"),   // 已完成 - 绿色
        PROCESSING("Processing"), // 处理中 - 紫色
        REJECTED("Rejected");     // 被拒绝 - 红色
        
        private final String displayName;
        
        OrderStatus(String displayName) {
            this.displayName = displayName;
        }
        
        public String getDisplayName() {
            return displayName;
        }
    }
    
    // 商品类型枚举
    public enum ProductType {
        ELECTRIC("Electric"),
        BOOK("Book"),
        MEDICINE("Medicine"),
        MOBILE("Mobile"),
        WATCH("Watch"),
        CLOTHING("Clothing"),
        FOOD("Food"),
        FURNITURE("Furniture");
        
        private final String displayName;
        
        ProductType(String displayName) {
            this.displayName = displayName;
        }
        
        public String getDisplayName() {
            return displayName;
        }
    }
    
    // 构造函数
    public SystemLogVo(String id, String name, String address, LocalDate date, String type, OrderStatus status) {
        this.id = id;
        this.name = name;
        this.address = address;
        this.date = date;
        this.type = type;
        this.status = status;
    }
    
    // Getter和Setter方法
    public String getId() { return id; }
    public void setId(String id) { this.id = id; }
    
    public String getName() { return name; }
    public void setName(String name) { this.name = name; }
    
    public String getAddress() { return address; }
    public void setAddress(String address) { this.address = address; }
    
    public LocalDate getDate() { return date; }
    public void setDate(LocalDate date) { this.date = date; }
    
    public String getType() { return type; }
    public void setType(String type) { this.type = type; }
    
    public OrderStatus getStatus() { return status; }
    public void setStatus(OrderStatus status) { this.status = status; }
    
    @Override
    public String toString() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd MMM yyyy");
        return String.format("Order{id='%s', name='%s', address='%s', date=%s, type='%s', status=%s}",
                id, name, address, date.format(formatter), type, status.getDisplayName());
    }
}